<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ page import="com.grep.extra.dao.impl.User" %>
<%
	request.setCharacterEncoding("UTF-8");
	response.setCharacterEncoding("UTF-8");  
	String username = request.getParameter("username");
	String password = request.getParameter("password");
		
	String sessionid = session.getId();
	
	User user = new User();
	
	boolean checkresult = user.checkUserExist(username, password);
	if(checkresult){
		session.setAttribute("username",username);
		session.setAttribute("password",password);
	}	
	
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">   
<title>游戏搜搜采集系统登录成功</title>
</head>
<script>
	<%if(checkresult){%>
	alert("登录成功，正在为您跳转首页")
	<%}else{ %>
	alert("登录失败，请重新登录")
	<%}%>
</script>
<%if(checkresult){%>
 <body onload= "setTimeout(window.location= '../index.jsp',3000) ">
<%}else{ %>
<body onload= "setTimeout(window.location= '../login.jsp ',3000) ">
<%}%>
</body>
</html>